package com.hontech.bv.utils

import com.hontech.bv.app.AppContext
import com.hontech.bv.codec.toMacStr
import java.io.IOException
import java.net.NetworkInterface


fun getMacAddr(name: String = NET_NAME): String {
    val ins = NetworkInterface.getByName(name) ?: throw IOException("无法获取MAC地址")
    val buf = ins.hardwareAddress
    if (buf == null) {
        return "未知MAC地址"
    }
    return buf.toMacStr()
}

val MacAddr = getMacAddr()

val PackageName = AppContext.packageName
val Version = AppContext.packageManager.getPackageInfo(PackageName, 0).versionName

val SDK_INT = android.os.Build.VERSION.SDK_INT


